package cn.jhz.learn.blog.service.security.resource.file.impl;

import cn.jhz.learn.blog.service.security.resource.file.FileValidationService;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

@Aspect
@Component
public class FileValidationAspect extends FilePointCutImpl{

    private final FileValidationService validationService;

    @Autowired
    public FileValidationAspect(FileValidationService validationService) {
        this.validationService = validationService;
    }

    @Before(value = "batchUpload(files)", argNames = "files")
    public void batchUploadParamVerification(List<MultipartFile> files) {
        //TODO:校验重复文件？
    }

    @Before(value = "batchUploadPicture(files)", argNames = "files")
    public void batchUploadPictureParamVerification(List<MultipartFile> files) {
        //TODO:校验重复文件？
    }
}
